package com.jy.api.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by hanxi on 2017/7/17.
 */
@Entity
@Data
@NoArgsConstructor
@ToString
public class WorkShift {
    @Id
    @Column(length = 50)
    private String id;
    private String storeId;
    private String storeName;
    @Temporal(TemporalType.TIMESTAMP)
    private Date beginTime;
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime;
    /**
     * 当班人id
     */
    private String operatorId;
    /**
     * 当班人名称
     */
    private String operatorName;

    /**
     * 开班人员工 工号
     */
    private String operatorCode;
    /**
     * 交班用户id
     */
    private String closeUserId;
    /**
     * 交班用户名称
     */
    private String closeUsername;
    /**
     * 总销售金额
     */
    private double turnInAmount;
    /**
     * 现金支付
     *
     * @deprecated
     */
    private double cashAmount;
    /**
     * 支付宝支付
     *
     * @deprecated
     */
    private double alipayAmount;
    /**
     * 微信支付
     *
     * @deprecated
     */
    private double wechatAmount;

    /**
     * 会员支付
     *
     * @deprecated
     */
    private double memberAmount;
    /**
     * 京东
     */
    private double jdAmount;
    /**
     * QQ钱包
     */
    private double qqAmount;
    /**
     * 会员
     */
    private double shimingAmount;
    /**
     * 银联
     */
    private double unionpayAmount;
    /**
     * 翼支付
     */
    private double bestpayAmount;

    /**
     * memberRechargeAmount
     */
    private  double memberRechargeAmount;
    /**
     * 支付统计，使用json存储。比如'{"pay.wechat.micropay": 100.00,"member":200.0, "cash":200}'
     */
    private String paymentStatics;
    /**
     * 退款金额
     */
    private double refundAmount;

    private double totalDis;

    private double total;

    private double totalRemoveZero;
    /**
     * 是否关班
     */
    @Column(name = "is_closed")
    private boolean closed = false;
    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date addTime;
    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    public WorkShift(String id, String storeId, String storeName, Date beginTime,
                     String operatorId, String operatorName, String operatorCode) {
        this.id = id;
        this.storeId = storeId;
        this.storeName = storeName;
        this.beginTime = beginTime;
        this.operatorId = operatorId;
        this.operatorName = operatorName;
        this.operatorCode = operatorCode;
    }
}
